<template lang="html">
	<section :class="$style.bookList">
		<BHeader :cname="$style.header"><span>{{tip}}</span></BHeader>
		<div :class="$style.list">
			<!-- 
			动态加载列表组件 
				1.下拉刷新
				2.下拉加载
			-->
			<div :class="$style.bookInfoBox" v-for="(item,index) in items" :key="index" @click.stop="clickItem(item._id)">
				<div :class="$style.bookImg"><img :src="item.cover" alt=""></div>
				<div :class="$style.bookInfo">
					<p>{{item.title}}</p>
					<p>{{item.shortIntro}}</p>
					<p>作者:&nbsp;{{item.author}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>{{item.latelyFollower}}</span>&nbsp;人气&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{item.majorCate}}</p>
				</div>
			</div>
		</div>

	</section>
</template>
<script>
	import BHeader from '../public/header.vue';
	export default {
		name: "booklist",
		components: {
			BHeader
		},
		data() {
			return {
				tip: '',
				items: [
					
				],
			}
		},
		activated() {
			this.getQuery();
		},
		methods: {
			getQuery() {
				try {
					this.tip = this.$route.query.tip;
					this.items = this.$route.query.list;
				}catch(err) {
					console.log(err);
				}
			},
			clickItem(bookId) {
				this.$route.push({name:'bookdetial',query:{bookId:bookId}});
			},
			
		}
	}
</script>
<style lang="scss" module>
  @import "../../../css/element.scss";
	.bookList {
		margin-top: 110px;
		background: #f5f5f5;
		.header {
			position: fixed;
			top: 0;
			z-index: 1000;
			text-align: left;
			background-color: rgba(255,255,255,0.72);
			span {
				text-align: left;
				margin-left: 64px;
			}
		}
		.list {
			@include list;
			padding-left: 32px;
			.bookInfoBox {
				@include list(row);
				flex-wrap: nowrap;
				width: 100%;
				overflow: hidden;
				box-sizing: border-box;
				padding-top: 20px;
				padding-bottom: 20px;
				border-bottom: 1px solid #d8d8d8;
				.bookImg {
					width: 210px;
					height: 240px;
					img {
						width: 100%;
					}
				}
				.bookInfo {
					flex: 1;
					display: inline-block;
					height: 240px;
					color: #8f8f8f;
					font-size: 27px;
					padding-left: 24px;
					p:nth-child(1) {
						color: #525252;
						font-size: 38px;
						margin-bottom: 24px;
					}
					p:nth-child(2) {
						width: 100%;
						font-size: 27px;
						letter-spacing: 4px;
						/* 显示2行,多的文字隐藏 */
						overflow:hidden; 
						text-overflow:ellipsis;
						display:-webkit-box; 
						-webkit-box-orient:vertical;
						-webkit-line-clamp:2;
					}
					p:nth-child(n+2){
						margin-top: 32px;
					}
					p:last-child {
						span {
							color: #ff0000;
						}
					}
				}
			}
			.bookInfoBox:last-child {
				border-bottom: none;
			}
		}
	}
</style>